//import style from '@/assets/NAME.module.scss';

import {} from '@/components';

export interface ProjectProps {
    threshold: number;
}

function Project(threshold: number) {
    console.log(time().format('{YYYY} HH:mm:ss'), `NAME render`);

    const [bottom, set_bottom] = useState(false);

    useEffect(() => {
        window.addEventListener('scroll', (e) => {
            const a =
                window.innerHeight ||
                document.documentElement.clientHeight ||
                document.body.clientHeight;
            const b =
                window.pageYOffset ||
                document.documentElement.scrollTop ||
                document.body.scrollTop;
            const c =
                document.documentElement.scrollHeight ||
                document.body.scrollHeight;

            if (c - a - b <= threshold) {
                set_bottom(true);
            } else {
                set_bottom(false);
            }
        });

        return () => {
            window.removeEventListener('scroll', (e) => {});
        };
    }, []);

    return [bottom];
}

export default Project;
